home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs05.d81
/
evsbasic.arc
/
EVSKEYWORDS.J-P
< prev
next >
Wrap
Text File
|
2009-10-10
|
10KB
|
273 lines
---------------------------------------
LINE <xpos>, <ypos> [[TO <xpos>, <ypos>]...]
The LINE statement draws a straight line on the bitmap screen, using the
current pen, starting at the current cursor position and ending at <xpos>,
<ypos>. LINE will always plot at least one point, even if the specified
<xpos>, <ypos> is the same as the current cursor position. After the line
is drawn the current cursor position is moved to <xpos>, <ypos>.
A LINE statement may optionally be followed by as many <xpos>, <ypos> pairs
separated by the TO keyword as will fit on a program line. This results in
a series of lines connected end-to-end.
The allowed range of <xpos>, <ypos> pairs depends on the current logical
screen coordinates. The default range is 0,0 to 319,199.
LINE functions only in graphic modes 4 and 5.
Examples:
10 LOCATE 0,0: LINE 319,199
20 LINE 10*X, Y+5
30 LOCATE X0,Y0: LINE X1,Y1 TO X2,Y2 TO X0,Y0
---------------------------------------
LOAD [<filename$>] [,<dvc>] [,<addr>]
The V2 Basic LOAD command has been modified to search for <filename$> on
the current default device if <dvc> is not specified. There is no other
change in its behavior.
Examples:
10 LOAD "MYPROGRAM"
20 LOAD "THISPROGRAM",9
30 LOAD "B*",8,1
---------------------------------------
LOCATE <xpos>, <ypos>
LOCATE sets the current cursor position in all graphic modes. In text
modes the allowed range of <xpos>, <ypos> is from 0,0 to 39,24. In bitmap
modes the range of <xpos>, <ypos> depends on the current logical screen
coordinates. The default range is 0,0 to 319,199.
Examples:
10 GRAPHIC 0: LOCATE 1, 10: PRINT "HELLO"
20 LOCATE I*10, I+5:
------------------------------------------
LOOP [WHILE/UNTIL <exp>]
The LOOP statement marks the end of a DO/LOOP repeat structure. The LOOP
statement is physically the last statement of the loop. Every LOOP must
have one, and only one, matching DO statement.
The basic DO/LOOP structure is unconditional, and all program statements
between a DO statement and a LOOP statement will repeatedly execute in
order forever (or until the program is halted by the STOP key). This is
useful in some cases, but more often a program exits from a DO/LOOP when
some condition is fulfilled.
A LOOP statement may optionally be followed by either the WHILE or UNTIL
conditional statements. A WHILE conditional will continue repeating the
loop only so long as <exp> is true. An UNTIL conditional will continue
repeating the loop only so long as <exp> is false. If the only exit from a
DO/LOOP is a conditional statement after the LOOP statement, the entire
loop will always be executed at least once.
When a DO/LOOP is terminated by WHILE, UNTIL, or EXIT, normal program
execution continues starting with the next statement after the LOOP
matching the DO.
DO/LOOPs may be nested within each other or within FOR/NEXT loops, and
FOR/NEXT loops may be nested within DO/LOOPs. The total number of active
nested loops of both kinds should not exceed nine.
Examples:
10 DO: PRINT "HELLO": LOOP
20 DO: GET A$: LOOP UNTIL A$<>""
---------------------------------------
MAK$(<length>, <char$>)
MAK$() returns a string consisting of the first character of <char$>
repeated <length> times. <Length> may range from 0 to 255. If <length> is
zero or <char$> is the null string, MAK$() returns the null string.
Examples:
10 A$ = MAK$(100, " ")
20 PRINT MAK$(A, A$)
---------------------------------------
PAGE
In all graphic modes the PAGE statement clears the screen and places the
cursor at the upper left hand corner. PAGE also fills color memory with
the current ink 1 color, although this is not usually apparent.
Examples:
10 PAGE
20 IF A$="Y" THEN PAGE
30 PAGE: LINE 319,199
---------------------------------------
PAINT [<filltype>] [,<boundary>]
The PAINT statement fills an area with the current pen color. The fill
starts at the current cursor position and spreads outward to the
<boundary>. The fill stops when there are no more pixels to be filled.
The cursor remains at its original location after filling. PAINT functions
only in graphic modes 4 and 5.
<Filltype> describes the pattern used during the fill, and may be either a
number or a character. If <filltype> is a number, it describes the
"density" of the fill. In this type of fill, pixels are filled either with
pen 0 or the current pen in a fixed proportion determined by <filltype>.
The value of <filltype> may range from 0 to 63, and can be thought of as
the number of pixels in each 8x8 area that will be colored with pen 0.
Thus, a <filltype> value of zero results in a solid fill, and a value of 32
yields a checkerboard pattern.
The normal pattern generated this way is quite regular. A much more random
pattern with a very different "texture" but about the same "density" for
any given value of <filltype> can be generated by adding 128 to the normal
value of 0 to 63.
If <filltype> is a string, the image pattern of the first character in the
string is used as the fill pattern. An exception occurs if the first
character in the string is [RVS ON] (CHR$(18)), in which case the reversed
image pattern of the second character in the string will be used. If the
pattern character is non-printable, or <filltype> is the null string, an
"?UNKNOWN CHAR" error will occur.
An image pattern is always taken from the currently active RAM character
set. Note that since the image pattern comes from a RAM character set it
may be redefined by the IMAGE statement, and thus the actual fill pattern
can be almost anything at all.
<Boundary> can range from 0 to 255, but all values over 3 result in a fill
that stops at any pixel with a value greater than 0. A <boundary> in the
range 0 to 3 sets a particular pixel value that the fill will stop at. Note
that a fill which stops only at a particular pixel value will fill over all
areas with other pixel values. In graphic mode 5, boundary pen values of 2
or 3 will fill the entire screen.
A PAINT statement with no parameters is interpreted as the equivalent of
PAINT 0,255 resulting in a solid fill that stops at any "on" pixel.
Examples:
10 PAINT
20 PAINT 32
30 PAINT ,0
40 PAINT A(I),2
50 PAINT "A", 3-CUR(-1)
---------------------------------------
PAPER [<border> [,<background> [,<multi/ext1> [,<multi/ext2> [,<ext3>]]]]]
The PAPER statement sets the current paper (background) colors of the
screen. This can be done at any time in any graphic mode. However, only
changes to <border> and <background> are immediately visible in all graphic
modes. The last three paper colors can be seen only in graphic modes 2 and
3.
In graphic modes 0, 1, 4, and 5 each color cell may contain only the
<background> paper color. In graphic mode 2, each color cell may also
display the <multi/ext1> and <multi/ext2> colors at the same time as the
<background> color. In graphic mode 3 each cell may display any one of the
last four paper colors.
The default paper colors are 14, 6, 1, 2, and 3.
Paper (background) colors differ from ink (foreground) colors in that all
screen color cells share the same paper color (a color cell colors either
one character (text modes) or 64 pixels in an 8x8 block (bitmap modes)).
Examples:
10 PAPER 14,6
20 PAPER 14,6,1,2,3
30 PAPER ,A
---------------------------------------
PEN <pen>
The PEN statement sets the current pen in graphic modes 4 and 5 (in text
modes the active pen is always considered to be pen 1, so that INK can
change the color of PRINTed characters). The current pen is used to alter
the values of pixels on the bitmap screen, which in turn affects the color
of the pixels.
<Pen> may range from 0 to 4. Pens 0 to 3 assign specific values to pixels,
and have specific colors associated with them. Pen 0 is associated with
the background paper color, which has the effect of "erasing" pixels. Pens
1 to 3 are associated with inks 1 to 3. Pen 4 is the "inverse" pen.
Rather than having a color of its own, it changes the current value of a
pixel to an "opposite" value (in graphic mode 4, pens 0 and 3 are opposites
and pens 1 and 2 are opposites. In mode 5, pen 0 is the opposite of each
of the pens 1, 2, and 3). Anything drawn with pen 4 can be erased by
drawing it over a second time with pen 4.
Any color may be associated with any of the pens 0 to 3 by the PAPER and
INK statements. There is no prohibition against two or more pens sharing
the same color. However, only graphic mode 4 allows three distinct ink
colors along with the paper color in the the same 8x8 pixel area colored by
one color cell. In graphic mode 5 only one ink color is allowed in a color
cell along with the paper color. Pens 2 and 3 can still be used and can
still have different colors, but they behave as if they are pen 1 (a point
to remember when using CUR() or PAINT, for example). This makes it
possible to use the same program in both graphic modes 4 and 5, although if
the color limitations are not observed the screen may appear very different
in each mode.
Examples:
10 PEN 1
20 PEN A(I)
---------------------------------------
POINT <xpos>, <ypos>
POINT uses the current pen to plot a single point at <xpos>, <ypos> on the
bitmap screen. The cursor is left at <xpos>, <ypos>. This statement
functions only in graphic modes 4 and 5. The range of <xpos>, <ypos>
depends on the current logical screen coordinates. The default range is 0,
0 to 319, 199.
Examples:
10 POINT 160,100
20 FOR I=1 TO 10: POINT X(I),Y(I): NEXT